import { IFRAME_SPECIAL_PAY } from '../../constants/index';
import { AliPayment } from "./ali-pay";
import { WxJSAPIPayment } from "./wx-pay";
import { H5BlankPayment } from "./h5-blank-pay";

const PAYMENT_MAP = {
  [IFRAME_SPECIAL_PAY.AliPay]: AliPayment, // 支付宝支付
  [IFRAME_SPECIAL_PAY.AliHuabeiPay]: AliPayment, // 支付宝支付
  [IFRAME_SPECIAL_PAY.WxJSAPIPay]: WxJSAPIPayment, // 微信支付
  [IFRAME_SPECIAL_PAY.H5BlankPay]: H5BlankPayment, //非服务商模式、购物车下单支付跳空白页
};

export function getspecialByType(type) {
  const Ctor = PAYMENT_MAP[type];
  return new Ctor();
}